home *** CD-ROM | disk | FTP | other *** search
- Path: isonews.bbn.hp.com!hpbblb!news
- From: Matthias Dittrich <matti>
- Newsgroups: comp.lang.c++
- Subject: Re: [HLP] Easy Problem w/ Classes!
- Date: 26 Feb 1996 16:56:31 GMT
- Organization: Hewlett-Packard Co.
- Message-ID: <4gsonv$p1c@hpbblb.bbn.hp.com>
- References: <4gfn3v$jp@news.umbc.edu>
- NNTP-Posting-Host: trabant.bbn.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
- X-URL: news:4gfn3v$jp@news.umbc.edu
-
- ssopre1@umbc.edu (Sunil ) wrote:
- >Hello all
- > Heres a little problem that I need help with.
- >
- >// Point.h contains
- >Class Point {
- >private: int x;
- > int y;
- >
- >public: Point()
- /* initialize private members here */
- {
- x=0;
- y=0;
- }
-
- >}
- > ...
-
- > ...
- >// LineSeg.C contains
- >LineSeg::LineSeg()
- >{
-
- delete the following four lines:
- > Point.end.x=0; // Are these valid?
- > Point.end.y=0; // What do I need to add/del here?
- > Point.start.x=0;
- > Point.start.y=0;
-
- >}
- > ...
- x and y are private members of Point, so you can't set them from outside
- class Point. Use the Point-constructor to do it.
-
- Good luck,
- Matthias
-
-